package cn.com.selfsoft.smartcity.commons.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.time.LocalDateTime;

/**
 * 抽象的审计实体
 *
 */
public abstract class AbstractAuditingEntity extends AbstractEntity {
	
	private static final long serialVersionUID = -3128372820671057629L;

	@JsonIgnore
	@TableField(value = "created_at",fill= FieldFill.INSERT)
	private LocalDateTime createdAt;

	@JsonIgnore
	private String createdBy;

	@JsonIgnore
	@TableField(value = "last_updated_at",fill= FieldFill.INSERT_UPDATE)
	private LocalDateTime lastUpdatedAt;

	@JsonIgnore
	private String lastUpdatedBy;

	@JsonIgnore
	private Integer version;
	
	public AbstractAuditingEntity() {
		
	}

	public LocalDateTime getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(LocalDateTime createdAt) {
		this.createdAt = createdAt;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public LocalDateTime getLastUpdatedAt() {
		return lastUpdatedAt;
	}

	public void setLastUpdatedAt(LocalDateTime lastUpdatedAt) {
		this.lastUpdatedAt = lastUpdatedAt;
	}

	public String getLastUpdatedBy() {
		return lastUpdatedBy;
	}

	public void setLastUpdatedBy(String lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}
	
}
